home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / p_man / cat3 / lmsgi.z / lmsgi
Text File  |  1998-10-30  |  25KB  |  925 lines

  1.  
  2.  
  3.  
  4. llllmmmmssssggggiiii((((3333))))                                                              llllmmmmssssggggiiii((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      lmsgi : license_init, license_chk_out, license_chk_in, license_timer,
  10.      license_set_attr, license_expdate, license_errstr, license_status - SGI
  11.      FFFFLLLLEEEEXXXXllllmmmm library
  12.  
  13. HHHHEEEEAAAADDDDEEEERRRR FFFFIIIILLLLEEEE
  14.      #include <lmsgi.h>
  15.  
  16. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  17.      This manual page describes the SGI interface to _l_i_b_l_m_s_g_i._a, the SGI
  18.      extension to Globetrotter Software's FLEXlm library.  This library
  19.      supports the interfaces provided by FLEXlm as well as the functions
  20.      described here.
  21.  
  22.      The SGI interface defines a small set of functions for licensing your
  23.      software using the FLEXlm, and consists of the following calls:
  24.  
  25.           license_init
  26.           license_chk_out
  27.           license_chk_in
  28.           license_timer
  29.           license_set_attr
  30.           license_expdate
  31.           license_errstr
  32.           license_status
  33.           get_job
  34.  
  35.      When using any of the liblmsgi library functions you must include the
  36.      following header and macro in your source file:
  37.  
  38.              #include <lmsgi.h>
  39.  
  40.              LM_CODE(code, ENCRYPTION_CODE_1, ENCRYPTION_CODE_2,
  41.                      VENDOR_KEY1, VENDOR_KEY2, VENDOR_KEY3,
  42.                      VENDOR_KEY4, VENDOR_KEY5);
  43.  
  44.      The -_l_l_m_s_g_i flag must be given to the C compiler to link programs which
  45.      contain calls to FLEXlm functions.
  46.  
  47.              cc file.o -llmsgi
  48.  
  49. EEEENNNNVVVVIIIIRRRROOOONNNNMMMMEEEENNNNTTTT
  50.      The following environment variables will modify the behavior of
  51.      applications licensed with this library.
  52.  
  53.      LLLLMMMM____LLLLIIIICCCCEEEENNNNSSSSEEEE____FFFFIIIILLLLEEEE
  54.           If set, specifies the name of one or more FLEXlm license files.
  55.           Multiple files can be specified by separating them with a colon (::::).
  56.           The specified files are checked first for FLEXlm licenses.
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. llllmmmmssssggggiiii((((3333))))                                                              llllmmmmssssggggiiii((((3333))))
  71.  
  72.  
  73.  
  74.      LLLLMMMM____LLLLIIIICCCCEEEENNNNSSSSEEEE____DDDDBBBB
  75.           If set, specifies the name of a license file database.  A license
  76.           file database is a file which contains a list of one or more FLEXlm
  77.           license files and/or directories containing FLEXlm license files.
  78.  
  79.           If _L_M__L_I_C_E_N_S_E__D_B is not defined the default license file database,
  80.           /_v_a_r/_f_l_e_x_l_m/_l_i_c_e_n_s_e_f_i_l_e._d_b, is used.
  81.  
  82.           The format of a license file database is one file or directory per
  83.           line.  Comments are indicated by a pound sign '#' in the first
  84.           column of the line.  Blank lines are ignored.  Trailing and/or
  85.           leading whitespace is not allowed on a line.
  86.  
  87.           Any directory listed in the file is searched for filenames matching
  88.           "*._d_a_t".  Any subdirectory is also searched (recursively).  All file
  89.           names must also end with the "*._d_a_t" extension.
  90.  
  91.  
  92.      If no license files have been defined by either the _L_M__L_I_C_E_N_S_E__F_I_L_E or
  93.      _L_M__L_I_C_E_N_S_E__D_B environment variables, the default FLEXlm license file is
  94.      /_v_a_r/_f_l_e_x_l_m/_l_i_c_e_n_s_e._d_a_t.
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. llllmmmmssssggggiiii((((3333))))                                                              llllmmmmssssggggiiii((((3333))))
  137.  
  138.  
  139.  
  140. NNNNAAAAMMMMEEEE
  141.      license_init - Initializes the FFFFLLLLEEEEXXXXllllmmmm library.
  142.  
  143. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  144.      #include <lmsgi.h>
  145.  
  146.      int license_init (VENDORCODE* code, char *vendorname,
  147.                        boolean_t heartbeat);
  148.  
  149.  
  150. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  151.      _l_i_c_e_n_s_e__i_n_i_t() initializes the FFFFLLLLEEEEXXXXllllmmmm library and creates a license job.
  152.      All subsequent calls to license_init() create new license jobs.  Each
  153.      license is independent.
  154.  
  155.  
  156.      ccccooooddddeeee Use the global variable "code" which was defined by the LM_CODE
  157.           macro (see above).
  158.  
  159.      vvvveeeennnnddddoooorrrrnnnnaaaammmmeeee
  160.           The name of the vendor daemon to use.
  161.  
  162.      hhhheeeeaaaarrrrttttbbbbeeeeaaaatttt
  163.           This is B_FALSE or B_TRUE.  If B_FALSE, then a default heartbeat
  164.           protocol is implemented.  FFFFLLLLEEEEXXXXllllmmmm will generate a SIGALRM at every
  165.           LM_A_CHECK_INTERVAL.  This will make a call to license_timer().  If
  166.           B_TRUE, then the SIGALRM is not generated, and it is up the
  167.           application to call license_timer() periodically.
  168.  
  169.  
  170. EEEEXXXXAAAAMMMMPPPPLLLLEEEE
  171.      /*
  172.       * The following code initializes the FFFFLLLLEEEEXXXXllllmmmm library and
  173.       * uses sgifd as the vendor daemon. If any errors are detected,
  174.       * then display them.
  175.       */
  176.  
  177.      if ( license_init (&code, "sgifd", B_FALSE) < 0 ) {
  178.              printf ("Initialization error: %s\n", license_errstr());
  179.      }
  180.  
  181.  
  182. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  183.      license_init() returns a 0 upon success or a value less than 0 if an
  184.      error is detected.  The error string can viewed via license_errstr().
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. llllmmmmssssggggiiii((((3333))))                                                              llllmmmmssssggggiiii((((3333))))
  203.  
  204.  
  205.  
  206. NNNNAAAAMMMMEEEE
  207.      license_chk_out - Attempts to check out a license.
  208.  
  209. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  210.      #include <lmsgi.h>
  211.  
  212.      int license_chk_out(VENDORCODE *code, char *feature, char *version);
  213.  
  214.  
  215. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  216.      _l_i_c_e_n_s_e__c_h_k__o_u_t() checks out one (or more) license(s) for the specified
  217.      feature and, for counted licenses, keeps the daemon up to date on the
  218.      status of the process using the license(s).
  219.  
  220.  
  221.      ccccooooddddeeee Use the global variable "code" which was defined by the LM_CODE
  222.           macro (see above).
  223.  
  224.      ffffeeeeaaaattttuuuurrrreeee
  225.           The ASCII feature name desired.
  226.  
  227.      vvvveeeerrrrssssiiiioooonnnn
  228.           The version of the feature desired in floating point format, 3
  229.           decimal places max.  This value must be less than or equal to the
  230.           version number in the license file for the check out to succeed.
  231.  
  232.      The default behavior of this library when a license request fails is to
  233.      print the standard SGI feature not found message and exit.  To override
  234.      this behavior, applications should set the attribute
  235.      _L_M_S_G_I__N_O__S_U_C_H__F_E_A_T_U_R_E using _l_i_c_e_n_s_e__s_e_t__a_t_t_r to register their own
  236.      callback before calling license_chk_out.
  237.  
  238.  
  239. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  240.      license_chk_out() returns a 0 upon success or a value less than 0 if an
  241.      error is detected.  The error string can viewed via license_errstr().
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. llllmmmmssssggggiiii((((3333))))                                                              llllmmmmssssggggiiii((((3333))))
  269.  
  270.  
  271.  
  272. NNNNAAAAMMMMEEEE
  273.      license_chk_in - Return a checked out license.
  274.  
  275. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  276.      #include <lmsgi.h>
  277.  
  278.      int license_chk_in(char *feature, int keep_conn);
  279.  
  280.  
  281. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  282.      _l_i_c_e_n_s_e__c_h_k__i_n() checks in the license of the specified feature that had
  283.      been previously checked out with license_chk_out().
  284.  
  285.  
  286.      ffffeeeeaaaattttuuuurrrreeee
  287.           The feature (license) name to be checked in.
  288.  
  289.      kkkkeeeeeeeepppp____ccccoooonnnnnnnn
  290.           A non-zero means "_K_e_e_p _c_o_n_n_e_c_t_i_o_n _t_o _s_e_r_v_e_r"; a 0 means drop TCP
  291.           connection.  A zero should always be used as the default.  Unused
  292.           for UDP.
  293.  
  294.           Consult the _F_L_E_X_l_m _P_r_o_g_r_a_m_m_e_r'_s _G_u_i_d_e for more details.
  295.  
  296.  
  297. EEEEXXXXAAAAMMMMPPPPLLLLEEEE
  298.      /*
  299.       * The following code returns the license, _d_u_m_m_y, back to the
  300.       * server. If any errors are detected, then display them.
  301.       */
  302.  
  303.      if ( license_chk_in ("dummy", 0) ) {
  304.              printf ("Check in error: %s\n", license_errstr());
  305.      }
  306.  
  307.  
  308. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  309.      license_chk_in() returns a 0 upon success or a value less than 0 if an
  310.      error is detected.  The error string can viewed via license_errstr().
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. llllmmmmssssggggiiii((((3333))))                                                              llllmmmmssssggggiiii((((3333))))
  335.  
  336.  
  337.  
  338. NNNNAAAAMMMMEEEE
  339.      license_timer - Verifies the connection to the license server.
  340.  
  341. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  342.      #include <lmsgi.h>
  343.  
  344.      void license_timer();
  345.  
  346.  
  347. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  348.      Periodic calls to _l_i_c_e_n_s_e__t_i_m_e_r() should be throughout the user's
  349.      application.  These calls are important because they verify that the
  350.      license currently checked out to your application remains valid.  The
  351.      user may want to call license_timer() before important steps in the
  352.      program (for example, before writing a file to disk).
  353.  
  354.  
  355. EEEEXXXXAAAAMMMMPPPPLLLLEEEE
  356.      /*
  357.       * application code
  358.       */
  359.  
  360.      license_timer();
  361.  
  362.      /*
  363.       * some more application code and then
  364.       * verify connection before writing to disk
  365.       */
  366.  
  367.      license_timer();
  368.  
  369.      /*
  370.       * some more application code
  371.       */
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. llllmmmmssssggggiiii((((3333))))                                                              llllmmmmssssggggiiii((((3333))))
  401.  
  402.  
  403.  
  404. NNNNAAAAMMMMEEEE
  405.      license_set_attr - Used to set different FFFFLLLLEEEEXXXXllllmmmm attributes.
  406.  
  407. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  408.      #include <lmsgi.h>
  409.  
  410.      int license_set_attr(int key, LM_A_VAL_TYPE value);
  411.  
  412.  
  413. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  414.      _l_i_c_e_n_s_e__s_e_t__a_t_t_r() set a FFFFLLLLEEEEXXXXllllmmmm attribute.  The key describes which
  415.      attribute to set and value describes the value for that attribute.  A
  416.      description of the attributes can be found in the FFFFLLLLEEEEXXXXllllmmmm _P_r_o_g_r_a_m_m_e_r'_s
  417.      _G_u_i_d_e or the header file _l_m__a_t_t_r._h.
  418.  
  419.  
  420.      kkkkeeeeyyyy  The FFFFLLLLEEEEXXXXllllmmmm attribute to set.
  421.  
  422.      vvvvaaaalllluuuueeee
  423.           Value to set the key to.  Values should be of the appropriate type
  424.           for the particular attribute, but should be cast to LM_A_VAL_TYPE.
  425.  
  426.  
  427. NNNNOOOOTTTTEEEESSSS
  428.      Four additional attributes have been defined in lmsgi:
  429.  
  430.  
  431.      LLLLMMMMSSSSGGGGIIII____NNNNOOOO____SSSSUUUUCCCCHHHH____FFFFEEEEAAAATTTTUUUURRRREEEE
  432.           A pointer to a function which is called when the requested feature
  433.           cannot be checked out.  This function is only called if
  434.           _l_i_c_e_n_s_e__c_h_k__o_u_t() fails with an _L_M__N_O_F_E_A_T_U_R_E error.
  435.  
  436.      LLLLMMMMSSSSGGGGIIII____33330000____DDDDAAAAYYYY____WWWWAAAARRRRNNNNIIIINNNNGGGG
  437.           A pointer to a function which is called when the requested feature
  438.           will expire within 30 days.
  439.  
  440.      LLLLMMMMSSSSGGGGIIII____66660000____DDDDAAAAYYYY____WWWWAAAARRRRNNNNIIIINNNNGGGG
  441.           A pointer to a function which is called when the requested feature
  442.           will expire within 60 days.
  443.  
  444.      LLLLMMMMSSSSGGGGIIII____99990000____DDDDAAAAYYYY____WWWWAAAARRRRNNNNIIIINNNNGGGG
  445.           A pointer to a function which is called when the requested feature
  446.           will expire within 90 days.
  447.  
  448.           The _l_m_s_g_i library sets default values for attributes in order to
  449.           provide standardized error handling and error messages for SGI
  450.           software.  To disable a pre-set attribute, either use
  451.           _l_i_c_e_n_s_e__s_e_t__a_t_t_r() to register a new callback that provides your
  452.           desired behavior, or register a _N_U_L_L callback to turn off the
  453.           default behavior.
  454.  
  455.           The pre-set attributes are as follows:
  456.  
  457.  
  458.  
  459.                                                                         PPPPaaaaggggeeee 7777
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466. llllmmmmssssggggiiii((((3333))))                                                              llllmmmmssssggggiiii((((3333))))
  467.  
  468.  
  469.  
  470.      LLLLMMMMSSSSGGGGIIII____NNNNOOOO____SSSSUUUUCCCCHHHH____FFFFEEEEAAAATTTTUUUURRRREEEE
  471.           This attribute is set to a function which displays information on
  472.           how to get a license for an SGI product.  This function also calls
  473.           _e_x_i_t(), thus the application exits when the requested feature cannot
  474.           be checked out.
  475.  
  476.      LLLLMMMMSSSSGGGGIIII____33330000____DDDDAAAAYYYY____WWWWAAAARRRRNNNNIIIINNNNGGGG
  477.           This attribute is set to do nothing if the license is about to
  478.           expire within 30 days.
  479.  
  480.      LLLLMMMMSSSSGGGGIIII____66660000____DDDDAAAAYYYY____WWWWAAAARRRRNNNNIIIINNNNGGGG
  481.           This attribute is set to do nothing if the license is about to
  482.           expire within 60 days.
  483.  
  484.      LLLLMMMMSSSSGGGGIIII____99990000____DDDDAAAAYYYY____WWWWAAAARRRRNNNNIIIINNNNGGGG
  485.           This attribute is set to do nothing if the license is about to
  486.           expire within 90 days.
  487.  
  488.      LLLLMMMM____AAAA____UUUUSSSSEEEERRRR____RRRREEEECCCCOOOONNNNNNNNEEEECCCCTTTT
  489.           This attribute is set to a function which displays a message noting
  490.           that the connection to the license server was lost, and an attempt
  491.           is being made to reconnect to the server.
  492.  
  493.      LLLLMMMM____AAAA____UUUUSSSSEEEERRRR____RRRREEEECCCCOOOONNNNNNNNEEEECCCCTTTT____DDDDOOOONNNNEEEE
  494.           This attribute is set to a function which displays a message noting
  495.           that the connection to the license server was lost, and the attempt
  496.           to reconnect to the server was successful.
  497.  
  498.      LLLLMMMM____AAAA____UUUUSSSSEEEERRRR____EEEEXXXXIIIITTTTCCCCAAAALLLLLLLL
  499.           This attribute is set to a function which displays a message noting
  500.           that the connection to the license server was lost, and the attempt
  501.           to reconnect to the server has failed.  This function also calls
  502.           _e_x_i_t(), thus the application exits when the reconnect fails.
  503.  
  504.  
  505. EEEEXXXXAAAAMMMMPPPPLLLLEEEE
  506.      /*
  507.       * The following code sets the LM_A_RETRY_COUNT to 5.
  508.       * If any errors are detected, then display them.
  509.       */
  510.  
  511.      if ( license_set_attr(LM_A_RETRY_COUNT, (LM_A_VAL_TYPE) 5) ) {
  512.              printf("Set attribute error: %s\n", license_errstr());
  513.      }
  514.  
  515.      /*
  516.       * The following code displays a message when a license will expire
  517.       * within 90 days.
  518.       */
  519.  
  520.      int expire_soon(daysLeft)
  521.          int daysLeft;
  522.  
  523.  
  524.  
  525.                                                                         PPPPaaaaggggeeee 8888
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532. llllmmmmssssggggiiii((((3333))))                                                              llllmmmmssssggggiiii((((3333))))
  533.  
  534.  
  535.  
  536.      {
  537.          (void) fprintf(stderr,
  538.                         "Your software license will expire in %d days.\n",
  539.                         daysLeft);
  540.  
  541.          return 0;
  542.      }
  543.  
  544.      /*
  545.       * The following code registers a callback for a license which
  546.       * will expire soon.
  547.       */
  548.  
  549.      if ( license_set_attr(LMSGI_30_DAY_WARNING, (LM_A_VAL_TYPE) expire_soon) ) {
  550.              printf("Set attribute error: %s\n", license_errstr());
  551.      }
  552.  
  553.  
  554.  
  555. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  556.      license_set_attr() returns a 0 upon success or a value less than 0 if an
  557.      error is detected.  The error string can viewed via license_errstr().
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.                                                                         PPPPaaaaggggeeee 9999
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598. llllmmmmssssggggiiii((((3333))))                                                              llllmmmmssssggggiiii((((3333))))
  599.  
  600.  
  601.  
  602. NNNNAAAAMMMMEEEE
  603.      license_expdate - Returns the expiration date of the feature checked out.
  604.  
  605. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  606.      #include <lmsgi.h>
  607.  
  608.      time_t license_expdate(char *feature);
  609.  
  610.  
  611. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  612.      _l_i_c_e_n_s_e__e_x_p_d_a_t_e() returns the expiration date of a feature (license).
  613.  
  614.  
  615.      ffffeeeeaaaattttuuuurrrreeee
  616.           The name of the feature (license).
  617.  
  618.  
  619. EEEEXXXXAAAAMMMMPPPPLLLLEEEE
  620.      /*
  621.       * The following code returns the expiration date of the
  622.       * feature, _d_u_m_m_y.
  623.       * If any errors are detected, then display them.
  624.       */
  625.      time_t feature_expdate;
  626.  
  627.      if ( ( feature_expdate = license_expdate("dummy") ) == -1 )
  628.              printf ("Expiration date error: %s\n", license_errstr());
  629.  
  630.  
  631.  
  632. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  633.      license_expdate() returns the expiration date of the given feature in
  634.      seconds since 00:00:00 UTC, January 1, 1970.  If the given feature is a
  635.      permanent feature (no expiration date) then license_expdate() returns 0.
  636.      If an error occurs, a value of (time_t)-1 is returned.
  637.  
  638.      Any error string can viewed via license_errstr().
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.                                                                        PPPPaaaaggggeeee 11110000
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664. llllmmmmssssggggiiii((((3333))))                                                              llllmmmmssssggggiiii((((3333))))
  665.  
  666.  
  667.  
  668. NNNNAAAAMMMMEEEE
  669.      license_errstr - Returns license server or system errors.
  670.  
  671. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  672.      #include <lmsgi.h>
  673.  
  674.      char* license_errstr();
  675.  
  676.  
  677. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  678.      _l_i_c_e_n_s_e__e_r_r_s_t_r() returns the FFFFLLLLEEEEXXXXllllmmmm error string for the most recent
  679.      FFFFLLLLEEEEXXXXllllmmmm error along with the major and minor number.  If a UUUUNNNNIIIIXXXX error is
  680.      involved, the UUUUNNNNIIIIXXXX error description will also be included in the
  681.      message, along with the UUUUNNNNIIIIXXXX _e_r_r_n_o.
  682.  
  683.  
  684. EEEEXXXXAAAAMMMMPPPPLLLLEEEE
  685.      /*
  686.       * The following code prints out the error
  687.       *
  688.       *   Cannot find license file (-1, 73:2), No such file or directory
  689.       *
  690.       * when the license file cannot be accessed.
  691.       *
  692.       */
  693.  
  694.      printf ("%s\n", license_errstr());
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.                                                                        PPPPaaaaggggeeee 11111111
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730. llllmmmmssssggggiiii((((3333))))                                                              llllmmmmssssggggiiii((((3333))))
  731.  
  732.  
  733.  
  734. NNNNAAAAMMMMEEEE
  735.      license_status - Returns the latest status of the checked out feature.
  736.  
  737. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  738.      #include <lmsgi.h>
  739.  
  740.      int license_status(char *feature);
  741.  
  742.  
  743. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  744.      _l_i_c_e_n_s_e__s_t_a_t_u_s() returns the status of the requested feature (license).
  745.      A return value of 0 indicates a successful return from the most recent
  746.      call to the FFFFLLLLEEEEXXXXllllmmmm library for that feature.  A return value value less
  747.      than 0 indicates an error from most recent call to the FFFFLLLLEEEEXXXXllllmmmm library.
  748.  
  749.  
  750.      ffffeeeeaaaattttuuuurrrreeee
  751.           The name of the feature.
  752.  
  753.  
  754. EEEEXXXXAAAAMMMMPPPPLLLLEEEE
  755.      /*
  756.       * The following code checks the status of the most recent FFFFLLLLEEEEXXXXllllmmmm
  757.       * library call.  If any errors occurred, then display them.
  758.       */
  759.  
  760.      license_chk_out (&code, "dummy", "2.000");
  761.  
  762.      if ( license_status ("dummy") < 0 ) {
  763.              printf ("error: %s\n", license_errstr());
  764.      }
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.                                                                        PPPPaaaaggggeeee 11112222
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796. llllmmmmssssggggiiii((((3333))))                                                              llllmmmmssssggggiiii((((3333))))
  797.  
  798.  
  799.  
  800. NNNNAAAAMMMMEEEE
  801.      get_job - Returns the FLEXlm job ID.
  802.  
  803. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  804.      #include <lmsgi.h>
  805.  
  806.      LM_HANDLE *get_job(void);
  807.  
  808.  
  809. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  810.      Returns the FLEXlm job ID so that applications can use the standard
  811.      FLEXlm functions along with the SGI interface.
  812.  
  813.      A return value of NULL indicates that there is currently no FLEXlm job
  814.      ID.
  815.  
  816.  
  817. EEEEXXXXAAAAMMMMPPPPLLLLEEEE
  818.      LM_HANDLE *job;
  819.      job = get_job();
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.                                                                        PPPPaaaaggggeeee 11113333
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862. llllmmmmssssggggiiii((((3333))))                                                              llllmmmmssssggggiiii((((3333))))
  863.  
  864.  
  865.  
  866. RRRREEEESSSSTTTTRRRRIIIICCCCTTTTIIIIOOOONNNNSSSS
  867.      The FlexLM licensing code uses the stdio functions (_f_o_p_e_n(), _f_g_e_t_s(),
  868.      etc). In some circumstances, a process may have more open file
  869.      descriptors than will fit in a FILE structure (field __f_i_l_e; see
  870.      /usr/include/stdio.h for details).  If this happens before the licensing
  871.      calls, acquiring the license will fail with the message:
  872.  
  873.      Cannot find license file (-1,212:2) No such file or directory
  874.  
  875.      The only solution is to reduce the number of file descriptors in use when
  876.      licensing calls are made. In practice this is only a problem with the O32
  877.      (5.3 compatible) ABI, which uses an _u_n_s_i_g_n_e_d _c_h_a_r to hold the file
  878.      descriptor (fd<=255).
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.                                                                        PPPPaaaaggggeeee 11114444
  922.  
  923.  
  924.  
  925.